@model EIMS.Models.Supplier

@{
    ViewData["Title"] = "创建供应商";
}

<div class="container-fluid">
    <h1 class="mt-4">创建供应商</h1>
    <ol class="breadcrumb mb-4">
        <li class="breadcrumb-item"><a asp-controller="Home" asp-action="Index">首页</a></li>
        <li class="breadcrumb-item"><a asp-controller="Supplier" asp-action="Index">供应商管理</a></li>
        <li class="breadcrumb-item active">创建供应商</li>
    </ol>

    <div class="card mb-4">
        <div class="card-header">
            <i class="fas fa-user-plus me-1"></i>
            供应商信息
        </div>
        <div class="card-body">
            <form asp-action="Create">
                <div asp-validation-summary="ModelOnly" class="text-danger"></div>
                
                <div class="row mb-3">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="SupplierNumber" class="control-label"></label>
                            <input asp-for="SupplierNumber" class="form-control" />
                            <span asp-validation-for="SupplierNumber" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="Name" class="control-label"></label>
                            <input asp-for="Name" class="form-control" />
                            <span asp-validation-for="Name" class="text-danger"></span>
                        </div>
                    </div>
                </div>

                <div class="row mb-3">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="Type" class="control-label"></label>
                            <select asp-for="Type" class="form-select" asp-items="ViewBag.Types"></select>
                            <span asp-validation-for="Type" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="CreditRating" class="control-label"></label>
                            <select asp-for="CreditRating" class="form-select" asp-items="ViewBag.CreditRatings"></select>
                            <span asp-validation-for="CreditRating" class="text-danger"></span>
                        </div>
                    </div>
                </div>

                <div class="row mb-3">
                    <div class="col-md-4">
                        <div class="form-group">
                            <label asp-for="ContactPerson" class="control-label"></label>
                            <input asp-for="ContactPerson" class="form-control" />
                            <span asp-validation-for="ContactPerson" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label asp-for="PhoneNumber" class="control-label"></label>
                            <input asp-for="PhoneNumber" class="form-control" />
                            <span asp-validation-for="PhoneNumber" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label asp-for="Email" class="control-label"></label>
                            <input asp-for="Email" class="form-control" />
                            <span asp-validation-for="Email" class="text-danger"></span>
                        </div>
                    </div>
                </div>

                <div class="row mb-3">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label asp-for="Address" class="control-label"></label>
                            <input asp-for="Address" class="form-control" />
                            <span asp-validation-for="Address" class="text-danger"></span>
                        </div>
                    </div>
                </div>

                <div class="row mb-3">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="Fax" class="control-label"></label>
                            <input asp-for="Fax" class="form-control" />
                            <span asp-validation-for="Fax" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="Website" class="control-label"></label>
                            <input asp-for="Website" class="form-control" />
                            <span asp-validation-for="Website" class="text-danger"></span>
                        </div>
                    </div>
                </div>

                <div class="row mb-3">
                    <div class="col-md-4">
                        <div class="form-group">
                            <label asp-for="BankName" class="control-label"></label>
                            <input asp-for="BankName" class="form-control" />
                            <span asp-validation-for="BankName" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label asp-for="BankAccount" class="control-label"></label>
                            <input asp-for="BankAccount" class="form-control" />
                            <span asp-validation-for="BankAccount" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label asp-for="TaxNumber" class="control-label"></label>
                            <input asp-for="TaxNumber" class="form-control" />
                            <span asp-validation-for="TaxNumber" class="text-danger"></span>
                        </div>
                    </div>
                </div>

                <div class="row mb-3">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label asp-for="Remarks" class="control-label"></label>
                            <textarea asp-for="Remarks" class="form-control" rows="3"></textarea>
                            <span asp-validation-for="Remarks" class="text-danger"></span>
                        </div>
                    </div>
                </div>

                <div class="row mb-3">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="Status" class="control-label"></label>
                            <select asp-for="Status" class="form-select" asp-items="ViewBag.Statuses"></select>
                            <span asp-validation-for="Status" class="text-danger"></span>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <button type="submit" class="btn btn-primary">
                        <i class="fas fa-save"></i> 保存
                    </button>
                    <a asp-action="Index" class="btn btn-secondary">
                        <i class="fas fa-arrow-left"></i> 返回列表
                    </a>
                </div>
            </form>
        </div>
    </div>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
} 